package com.rentplant.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.afterservice;
import com.rentplant.Pojo.serviceandorderanditem;
import com.rentplant.mapper.afterServiceMapper;
import com.rentplant.service.afterServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service //让他知道这是service
public class afterServiceImp implements afterServiceService {

    @Autowired
    private afterServiceMapper afterservicemapper;


    //查找用户售后服务订单
    @Override
    public List<serviceandorderanditem> afterService(JSONObject serviceinfo){
        return afterservicemapper.afterService(serviceinfo);
    }


    //提交售后申请
    @Override
    public boolean addAfterService(JSONObject serviceinfo){
        return afterservicemapper.addAfterService(serviceinfo);
    }


    //查询该订单是否有售后申请
    @Override
    public  List<afterservice> selectAfterService(JSONObject serviceinfo){
        return afterservicemapper.selectAfterService(serviceinfo);
    }



    //    申请管理
//    查询全部申请并分页
    @Override
    public List<afterservice> allApply(JSONObject pageinfo){return afterservicemapper.allApply(pageinfo);}

    //    查询全部申请
    public List<afterservice> allApplys(){return afterservicemapper.allApplys();}

    //    不同意售后申请
    @Override
    public boolean refuseApply(JSONObject applyinfo){return afterservicemapper.refuseApply(applyinfo);}

    //    按条件查找
    @Override
    public List<afterservice> searchAfter(JSONObject searchinfo){return afterservicemapper.searchAfter(searchinfo);}

    //    按条件查找
    @Override
    public List<afterservice> searchAfters(JSONObject searchinfo){return afterservicemapper.searchAfters(searchinfo);}

}
